package com.neusoft.elm_servlet.controller;

import java.sql.SQLException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neusoft.elm_servlet.po.Business;
import com.neusoft.elm_servlet.service.BusinessService;
import com.neusoft.elm_servlet.service.impl.BusinessServiceImpl;

public class BusinessController {

	BusinessService businessService = new BusinessServiceImpl();
	
	public List<Business> listBusinessByOrderTypeId(HttpServletRequest request,HttpServletResponse response) throws SQLException{
		//获取参数
		String orderTypeId = request.getParameter("orderTypeId");
		//将参数传给对象调用方法，获取返回值
		List<Business> list = businessService.listBusinessByOrderTypeId(orderTypeId);
		
		return list;
	}
	
	public Business getBusinessById(HttpServletRequest request,HttpServletResponse response) throws SQLException{
		String businessId = request.getParameter("businessId");
		Business business = businessService.getBusinessById(businessId);
		
		return business;
	}
}
